//Our includes
#include "Leg.h"
#include "Station.h"


/*!
\brief Constructor
Sets the To and From station to NULL
*/
Leg::Leg() {
    To = NULL;
    From = NULL;
}

/*!
 \brief Destructor
 This object doesn't delete the to and from stations
 */
Leg::~Leg() {



}

/*!
  \brief Gets the To station

  This function could return null if SetTo() was not called

  Also see SetTo() and IsValid().
  */
Station* Leg::GetTo() {
    return To;
}

/*!
  \brief Set the To station

  Also see GetTo()
  */
void Leg::SetTo(Station* to) {
    To = to;
}

/*!
  \brief Get the From station

  This function could return NULL if SetForm() was not called

  Also see SetFrom() and IsValid()
  */
Station* Leg::GetFrom() {
    return From;
}

/*!
  \brief Set the From station

  Also see GetFrom()
  */
void Leg::SetFrom(Station* from) {
    From = from;
}

/*!
 \brief Checks to see if this Leg is valid
 \returns true if the Leg is valid and false if it's not

 Checks to see if the from and to stations where set, ie they aren't NULL

 */
bool Leg::IsValid() {
    if(To == NULL || From == NULL) {
        return false;
    }
    return true;
}
